<template>
  <router-view></router-view>
</template>

<script lang="ts">
import {provide, ref} from "vue";
import {router} from "./router";

export default {
  name: "App",
  setup() {
    const width = document.documentElement.clientWidth;
    const menuVisible = ref(width > 500);
    provide('menuVisible', menuVisible) // set
    router.afterEach(() => {
      // 如果当前是pc
      if(width <= 500 ) {
        menuVisible.value = false
      }
    })
  }
};
</script>

<style>
</style>
